package com.pr.makfilm.core.cmp.web;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.IModel;

/**
 * Created with IntelliJ IDEA.
 * User: Barbara
 * Date: 22.10.13
 * Time: 01:02
 * To change this template use File | Settings | File Templates.
 */
public class BootstrapTextArea<T> extends AbstractBootstrapComponent
{
   private TextArea textArea;

   public BootstrapTextArea(String id, IModel<T> model)
   {
      super(id);
      textArea = new TextArea("area", model);
      container.add(textArea);
   }

   public BootstrapTextArea(String id, IModel<T> model, String cssClazz)
   {
      this(id, model);
      this.cssClass = cssClazz;
   }

   @Override
   public void setValidation(boolean required)
   {
      textArea.setRequired(required);
   }

   @Override
   public Component getField()
   {
      return textArea;
   }
}
